#include <iostream>
#include <cstring>

using namespace std;

void deletelchr(char *str, const char cc=' ')
{
    if(str == nullptr) return;
    char *p = str;

    while(*p == cc) p++;

    memmove(str, p, strlen(str)-(p-str)+1);     //  考虑到内存重叠情况，用memmove而不用memcpy
}

int main(void)
{
    char str[31] = "aaabcdaaeee dacaaa";
    deletelchr(str, 'a');
    cout << '=' << str << '=' << endl;
    return 0;
}
